package com.example.httpprocessor.http;

import com.example.httpprocessor.annotation.BindOkhttp;
import com.example.httpprocessor.annotation.BindVolley;

import javax.inject.Singleton;

import dagger.Binds;
import dagger.Module;
import dagger.hilt.InstallIn;
import dagger.hilt.components.SingletonComponent;

@Module
@InstallIn(SingletonComponent.class)
public abstract class HttpProcessorModule {

    @BindOkhttp  //  调用哪一个方法  ApplicationComponent
    @Binds   //  邦定
    @Singleton  //  单例
    abstract IHttpProcessor bindOkhttp(OKHttpProcessor okHttpProcessor);


    @BindVolley  //  调用哪一个方法
    @Binds   //  邦定
    @Singleton  //  单例
    abstract IHttpProcessor bindVolley(VolleyProcessor volleyProcessor);

    @BindVolley  //  调用哪一个方法
    @Binds   //  邦定
    @Singleton  //  单例
    abstract IHttpProcessor bindXUtils(XUtilsProcessor xUtilsProcessor);

}
